package br.com.roteador.component;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.apache.log4j.Logger;

@ApplicationScoped
public class InitializationResourceBean {

    private static final Logger LOG = Logger.getLogger(InitializationResourceBean.class);
    @Inject private LocalizacaoPushThread pushThread;
    private ExecutorService managedExecutorService = Executors.newFixedThreadPool(10);
    
    public void listen(@Observes LocalizacaoPushService.SomeDummyEvent event) {
    }

    @PostConstruct
    public void init() {
    	pushThread.setListaContexto();
    	//managedExecutorService.submit(pushThread);
    }

    @PreDestroy
    public void destroy() {}
}